<?php 

 
	if(!isset($GLOBALS['shopperpress']['theme'])){ $GLOBALS['shopperpress']['theme']= get_option('shopperpress_theme'); }

	if(file_exists(FilterPath()."/wp-content/themes/shopperpress/themes/".$GLOBALS['shopperpress']['theme'].'/single.php')){
	
		include(FilterPath()."/wp-content/themes/shopperpress/themes/".$GLOBALS['shopperpress']['theme'].'/single.php');
	
	}else{
	 

	get_header( );  if (have_posts()) : while (have_posts()) : the_post();

	$category = get_the_category();

	/* ====================== SHOPPERPPRESS - GET CUSTOM FIELD VALUES FOR THIS POST =========================== */

 	$item 							= array();
	$item['type'] 					= get_post_meta($post->ID, "type", true);
	$item['qty'] 					= get_post_meta($post->ID, "qty", true);
	$item['old_price'] 				= GetPrice(get_post_meta($post->ID, "old_price", true));
	$item['price'] 					= GetPrice(get_post_meta($post->ID, "price", true));
	$item['amazon_link'] 			= get_post_meta($post->ID, "amazon_link", true);
	$item['warranty'] 				= get_post_meta($post->ID, "warranty", true);
	$item['affiliate_productID'] 	= get_post_meta($post->ID, "affiliate_productID", true);
	$item['link'] 					= get_post_meta($post->ID, "link", true);	
	$item['buy_link'] 				= get_post_meta($post->ID, "buy_link", true);
	$item['show_price'] 			= $GLOBALS['shopperpress']['price_tag'];
	$DisplayImage 					= get_post_meta($post->ID, "image", true);

	
	if($GLOBALS['shopperpress']['price_tag'] =="member" && $current_user->ID == 0){ 
	
		$item['show_price'] ="no";
	 
	}
	
	if(isset($_SESSION['ddc']['productsincart'][$post->ID])){ 

		$item['current_amount'] =  $_SESSION['ddc']['productsincart'][$post->ID];
	}else{

		$item['current_amount'] =0;
	}
	
	$item['qty'] = $item['qty']- $item['current_amount'];

	/* ====================== SHOPPERPPRESS SETUP FOR AMAZON STORE SYSTEM TYPE =========================== */


	if($GLOBALS['shopperpress']['system'] == "amazon-store"){
		$item['amazon_link'] = "";
		$item['affiliate_productID'] = "";
	}

// UPDATE HIT COUNTER FOR ARTICLE VIEWS
if($item['type'] =="article"){ 

mysql_query("UPDATE `$wpdb->postmeta` SET meta_value=meta_value+1 WHERE meta_key='hits' AND post_id='".$post->ID."' LIMIT 1");

}

?>

<?php

/***************** EXTRA PAGE CSS STYLES ****************************/
/********************************************************************/

?>
<style>.container_12 .grid_8 {	overflow:visible;}</style>

<?php 


/********************* ADMIN EDIT PAGE LINK ****************************/
/***********************************************************************/


edit_post_link('<div class="" style="padding:10px; background:red; color:#fff; text-decoration:none; width:940px; margin-left:10px;"><b>Admin Options:</b> Edit this item</div>','','.');  ?>

<div style="clear:both;"></div>

<?php 


/***************** TOP PAGE NAVIGATION ****************************/
/******************************************************************/

if(get_option("display_nextnav") =="yes"){ ?>

		<div class="navigation" style="width:920px; height:40px; margin-left:20px;">
			<div class="alignleft" style="width:450px; float:left;">
			<?php previous_post_link('<img src="../wp-content/themes/shopperpress/images/ppre.png" align="absmiddle"> %link') ?></div>
			<div class="alignright" style="width:470px; float:left; text-align:right">
			<?php next_post_link('<img src="../wp-content/themes/shopperpress/images/pnext.png" align="absmiddle"> %link') ?></div>
		</div>
		<div style="clear:both;"></div>
<?php 


}

/******************** END PAGE NAVIGATION *******************************/
/************************************************************************/

?>

<table border="0" cellpadding="0" cellspacing="0" style="width:970px;margin-left:5px;"><tr><td width="775" height="200px" valign="top">


<?php 

 
/********************* START THE NORMAL PAGE DISPLAY FOR A PRODUCT ***********************/
/******************************************************************************************/
 

if($item['type'] !="article"){ ?>



<?php

/***************** DISPLAYS THE TOP BAR WITH THE CATEGORY ****************************/
/*************************************************************************************/

?>
<h1 class="ItemBoxTop StopTop" style="margin-top:0px;">
	<a href="<?php if($category[0]->term_id !=""){ echo get_category_link($category[0]->term_id ) ; } ?>" class="ItemLineHeight">
		<?php echo $category[0]->cat_name; ?>
    </a>
	<span><?php echo SPEC($GLOBALS['_LANG']['_itemid']); ?>: #<?php echo $post->ID; ?></span>
</h1>


<div class="ItemBox" style="width:753px"><br />

<?php

/***************** LEFT BOX WITH MAIN IMAGE AND PAGE BUTTONS ****************************/
/****************************************************************************************/

?>
<div id="Left_ItemBox">

	
	<?php if(get_option("display_single_op6") != "no"){ ?>
    <div id="Left_ItemBox_img"><center><img src="<?php echo SPImage($DisplayImage,"l"); ?>" style="max-width:240px; max-height:250px;"></center></div><br />
	<?php } ?>
    <div style="clear:both;"></div>
    <div id="gallery">
    <?php if(get_option("display_single_op5") !="no"){ ?>
	<div class="buttons"> 
		<a href="<?php echo SPImage($DisplayImage,"l"); ?>" rel="lightbox[album]" target="_blank">
        	<img src="<?php bloginfo('template_url'); ?>/images/icon0.png" alt="<?php echo SPEC($GLOBALS['_LANG']['_m1']); ?>"/> <?php echo SPEC($GLOBALS['_LANG']['_m1']); ?>
        </a>
 	</div>	
    <?php } ?>
	<?php if(get_option("display_imagesection") =="yes" && function_exists('shopperPress_lightbox')) {shopperPress_lightbox(get_post_meta($post->ID, 'images', true)); } ?>
	</div>
	<div style="clear:both;"></div>
    
	<?php
    
    /***************** BUTTONS UNDER THE MAIN IMAGE ****************************/
    /********************************************************************/
    
    ?>
         
	<div class="buttons"> 
		<?php if(get_option("display_single_op1") !="no"){ ?>
        	<a href="javascript:bookmark_us('<?php echo get_permalink($post->ID); ?>','<?php the_title(); ?>')" title="Bookmark This Page">
            	<img src="<?php bloginfo('template_url'); ?>/images/icon1.png" alt="<?php echo SPEC($GLOBALS['_LANG']['_m2']); ?>"/>
                	<?php echo SPEC($GLOBALS['_LANG']['_m2']); ?>
            </a>
		<?php } ?>        
		<?php if(get_option("display_single_op2") !="no"){ ?>
        	<a href="mailto:?subject=I found this great product!&body=The page link is: <?php echo get_permalink($post->ID); ?>">
            	<img src="<?php bloginfo('template_url'); ?>/images/icon2.png" alt="<?php echo SPEC($GLOBALS['_LANG']['_m3']); ?>"/>
                	<?php echo SPEC($GLOBALS['_LANG']['_m3']); ?>
            </a>
		<?php } ?>
		<?php if(get_option("display_single_op3") !="no"){ ?>
        	<a href="javascript:void(0);" onClick="javascript:window.print()";>
            	<img src="<?php bloginfo('template_url'); ?>/images/icon4.png" alt="<?php echo SPEC($GLOBALS['_LANG']['_m4']); ?>"/>
                	<?php echo SPEC($GLOBALS['_LANG']['_m4']); ?>
            </a>
		<?php } ?>
		<?php if(get_option("display_single_op4") !="no"){ ?>
        	<a href="mailto:<?php echo get_option('shipping_email'); ?>?subject=<?php the_title(); ?>&body=The page link is: <?php echo get_permalink($post->ID); ?>">			
            	<img src="<?php bloginfo('template_url'); ?>/images/icon3.png" alt="<?php echo SPEC($GLOBALS['_LANG']['_m5']); ?>"/>
					<?php echo SPEC($GLOBALS['_LANG']['_m5']); ?>
             </a>
		<?php } ?>
        
	</div><div style="clear:both;"></div>
    
    <br />

</div>


<?php

/***************** RIGHT OPTIONS WITH ADD TO CART / DOWNLOAD BUTTONS ****************************/
/************************************************************************************************/

?>

<div id="Right_ItemBox">

	<h2><?php the_title(); ?></h2>
 
	<div style="clear:both;"></div>

	<br />
	
	<?php if($GLOBALS['adminads'] ==1){ 
	
		if(file_exists(FilterPath()."/wp-content/themes/shopperpress/ads/_ad_single_top.php")){ 
			include(FilterPath()."/wp-content/themes/shopperpress/ads/_ad_single_top.php");
		}
	
	 } ?>

	<hr />

	<div style="min-height:100px;">


    <?php 
	 
	/***************** DOWNLOAD SYSTEM *****************/
	/***************************************************/

 
	if($GLOBALS['shopperpress']['system'] =="download"){ ?>
    
        <div class="paybox" style="width:440px;"> 
        
        <?php the_excerpt(); ?>
        
        <?php if (get_option("shopperpress_system_login") == "yes" && !$user_ID ) { ?>
        
        <div class="Btn" id="downloadBtn" style="align:center; margin-top:20px; margin-left:0px;">	 
            <a href="<?php bloginfo('url'); ?>/wp-login.php">
				 <?php echo SPEC($GLOBALS['_LANG']['_login']); ?>
            </a> 
        </div>
             
        <?php }else{ ?>
        
        <form action="" method="POST" name="downloadform">
            <?php wp_nonce_field('ShopperPressDownload') ?>
            <input type="hidden" name="hash" value="123">
            <input type="hidden" name="fileID" value="<?php echo $post->ID; ?>">
            <div class="Btn" id="downloadBtn" style="align:center; margin-top:20px; margin-left:0px;">	 
               <a  href="#" onclick="document.downloadform.submit();" >
                    <?php echo SPEC($GLOBALS['_LANG']['_download']) ?>
               </a>
             </div>             
            </form>
            
           <?php } ?> 
            
          </div>
            
	<?php 
	
	/***************** CREDIT DOWNLOAD SYSTEM *****************/
	/***************************************************/
	
	}elseif($GLOBALS['shopperpress']['system'] =="credit"){ 

			$MyCredits=0;
			if(is_numeric($current_user->aim) && $current_user->aim > 0){
			$MyCredits = $current_user->aim;
			}
	?>

	
	  <div class="paybox" style="width:440px;">

		<?php if($GLOBALS['shopperpress']['system'] =="credit" && $MyCredits > 0){  ?>
		<form action="" method="POST" name="downloadform">
		<?php wp_nonce_field('ShopperPressDownload') ?>
		<input type="hidden" name="hash" value="123">
			<div class="Btn" id="downloadBtn" style="float:right; margin-top:20px;">
            	<a <?php global $user_ID; if ( $user_ID ) : ?>href="#" onclick="document.downloadform.submit();" <?php else :  ?>href="<?php bloginfo('url'); ?>/wp-login.php?action=login"<?php endif; ?> title="<?php the_title(); ?>">
					<?php echo SPEC($GLOBALS['_LANG']['_download']) ?>
                </a>
            </div>  
		</form>
        <?php } ?>

		<div id="Right_ItemBox_Price">
        	<span class="newprice">
				<?php if($item['price'] =="" || $item['price'] =="0"){ echo "Free Download"; }else{ echo $_SESSION['currency_symbol']." ".$item['price']; } ?>
            </span>
        </div>

		<p><?php echo SPEC($GLOBALS['_LANG']['_shoppingcarta']) ?> <strong><?php echo $MyCredits; ?></strong> <?php echo SPEC($GLOBALS['_LANG']['_cremaining']); ?></p>

		<div id="downloadLink"></div>

		<?php  if(function_exists('wp_gdsr_render_article')){wp_gdsr_render_article(10);} ?>

 
	</div>
 
	<?php 
	
	
	/***************** SHOPPING CART SYSTEM *****************/
	/********************************************************/
	
	
	}elseif($GLOBALS['shopperpress']['system'] =="cart" || $GLOBALS['shopperpress']['system'] =="catalog" || $GLOBALS['shopperpress']['system'] =="amazon-store"){  ?>

		<div class="paybox" style="width:440px;<?php if($item['show_price'] =="no"){ ?>display:none; <?php } ?>">
	
		<?php if(get_option("display_cart") =="yes" && $item['buy_link'] =="" && $item['amazon_link'] =="" && $item['affiliate_productID'] =="" && get_option("display_cart") =="yes" && ( $item['qty'] > 0 || get_option("display_ignoreQTY") =="yes") && $GLOBALS['shopperpress']['system'] !="catalog" ){ ?>
        	<div id="BuyButton" class="Btn" style="float:right; margin-top:20px;display:visible;">
            	<a href="#" title="<?php the_title(); ?>" onclick="<?php if(get_option("display_ignoreQTY") !="yes"){ ?> CheckRemaindingQty(<?php echo $item['qty']; ?>);<?php } ?> <?php echo getBuyLink($post,5); ?>;" style="font-size:14px;">
					<?php echo SPEC($GLOBALS['_LANG']['_addtocart']) ?>
                </a>
              </div>
			 <?php } ?>
	
		<!-- AMAZON BUY BUTTON -->
		<?php if($item['amazon_link'] !=""){ $hidePay=1; ?>
        	<a href="<?php echo ShopperAffiliateLink($item['amazon_link'],$post->ID) ?>" target="_blank">
            	<img src="<?php bloginfo('template_url'); ?>/images/buy-button-amazon.gif" style="float:right;">
             </a>
         <?php } ?>

		<!-- AFFILIATE BUY BUTTON -->
		<?php if($item['affiliate_productID'] !=""){ $hidePay=1; ?>
        	<a href="<?php echo ShopperAffiliateLink($item['link'],$post->ID) ?>" target="_blank">
            	<img src="<?php bloginfo('template_url'); ?>/images/buybtn.png" style="float:right;">
            </a>
         <?php } ?>
        
        <!-- EXTRA AFFILIATE BUY BUTTON -->
		<?php if($item['buy_link'] !=""){ $hidePay=1; ?>
        	<a href="<?php echo ShopperAffiliateLink($item['buy_link'],$post->ID) ?>" target="_blank">
            	<img src="<?php bloginfo('template_url'); ?>/images/buybtn.png" style="float:right;">
             </a>
        <?php } ?>


		<?php 
		// SHOW OR HIDE THE PRICE TAGS

		if($item['show_price'] =="yes"){ ?>

		<div id="Right_ItemBox_Price">
        
			<?php if($item['old_price'] > 0){ ?>
            	<span class="oldprice">
					<?php echo SPEC($GLOBALS['_LANG']['_was']) ?> <strike><?php echo $_SESSION['currency_symbol']." ".ShopperPressMoneyFormat($item['old_price']); ?></strike>
                </span>
			<?php } ?>
            
            <span class="newprice">
			<?php echo SPEC($GLOBALS['_LANG']['_now'])."  ".$_SESSION['currency_symbol']." ".ShopperPressMoneyFormat($item['price']); ?></span></div>

		<?php if(get_option("display_single_clink") =="yes"){ ?><p><a href="http://finance.yahoo.com/currency/convert?amt=<?php echo GetPrice(get_post_meta($post->ID, "price", true)); ?>&from=<?php echo $_SESSION['currency_code']; ?>&to=USD&submit=Convert" target="_blank"><?php echo SPEC($GLOBALS['_LANG']['_vc']) ?></a></p><?php } ?>

		<?php } ?>

	
		</div>
 
		<?php 
		
		// HIDE THE ADD TO CART BOX IF THE AFFILIATE LINK IS SET
		
		if( !isset($hidePay) && $item['show_price'] !="no" ){ ?>
 
		<div id="ItemListsLeft">

			<!--
			ITEM QUANTITY AREA
			-->

			<div id="displayQtyField">
			<p class="note"><b><?php echo SPEC($GLOBALS['_LANG']['_qty']); ?>:</b>  

			<?php if($item['qty'] ==1){ ?>

			<input type="text" name="" value="1" style="width:30px; margin-left:15px;" onChange="ChangeCustomQty(this.value);" disabled>

			<?php }elseif($item['qty'] < 1 && get_option("display_ignoreQTY") =="no"){ ?>

			<input type="text" name="" value="0" style="width:30px; margin-left:15px;" onChange="ChangeCustomQty(this.value);" disabled>

			<?php }elseif($item['qty'] > 1){ ?>

			<select onChange="ChangeCustomQty(this.value);" id="UpdateQtyBox">
			<?php $i=1; $t=$item['qty']; while($t >= 1){ ?>
			<option><?php echo $i; ?></option>
			<?php $t--; $i++; } ?>
			</select>
			
			<?php }else{ ?>

			<input type="text" name="" value="1" style="width:30px; margin-left:15px;" onChange="ChangeCustomQty(this.value);">

			<?php } ?>

			</p>
			</div>

			
			<p class="note">
			
			<?php if(  get_option("display_ignoreQTY") =="no" && $item['qty'] < 1  && $item['amazon_link'] ==""){  echo SPEC($GLOBALS['_LANG']['_nostock']) ?> 
			<?php }else{  echo SPEC($GLOBALS['_LANG']['_instock']); } ?>
                
            </p>
			
			<div class="ItemTags"><?php the_category(', ') ?> <?php the_tags( '<p>Tags: ', ', ', '</p>'); ?></div>

		</div>
        
        
        <?php 
	
	
		/***************** CUSTOM LIST OPTIONS *****************/
		/********************************************************/
		
		?>

		<div id="ItemListsRight">		

		
			<?php if(get_post_meta($post->ID, "customlist1", true) !=""){ $SIZEARRAY = explode(",",get_post_meta($post->ID, "customlist1", true)); ?>
				<p style="line-height:30px;"><b><?php echo get_option('custom_field1'); ?>:</b><br />
				<select size=1 onChange="ChangeCustomSize(this.value); return false;" style="font-size:14px; min-width:180px; height:25px; border:1px solid #ccc;  font-family:Arial, Verdana, sans-serif;"><option value="">-----------</option><?php foreach($SIZEARRAY as $value){ ?><option value="<?php echo $value; ?>"><?php echo $value; ?></option><?php } ?></select>
				</p>	
			<?php } ?>
			
			<?php if(get_post_meta($post->ID, "customlist2", true) !=""){ $COLORARRAY = explode(",",get_post_meta($post->ID, "customlist2", true)); ?>
				<p style="line-height:30px;"><b><?php echo get_option('custom_field2'); ?>:</b><br />
				<select size=1 onChange="ChangeCustomColor(this.value); return false;" style="font-size:14px; min-width:180px; height:25px; border:1px solid #ccc;  font-family:Arial, Verdana, sans-serif;"><option value="">-----------</option><?php foreach($COLORARRAY as $value){ ?><option value="<?php echo $value; ?>"><?php echo $value; ?></option><?php } ?></select>
				</p>
			<?php } ?>
            
            
 			<?php if(get_post_meta($post->ID, "customlist3", true) !=""){ $COLORARRAY = explode(",",get_post_meta($post->ID, "customlist3", true)); ?>
				<p style="line-height:30px;"><b><?php echo get_option('custom_field3'); ?>:</b><br />
				<select size=1 onChange="ChangeCustomExtra(this.value); return false;" style="font-size:14px; min-width:180px; height:25px; border:1px solid #ccc;  font-family:Arial, Verdana, sans-serif;"><option value="">-----------</option><?php foreach($COLORARRAY as $value){ $c3v = explode("=",$value); ?><option value="<?php echo $c3v[0]; ?>"><?php echo $c3v[1]; ?></option><?php } ?></select>
				</p>
			<?php } ?>           
 
		
		</div> 


	</div>

<?php } ?>

	<?php } ?>
    
    
    
    
  	<!-- end BUY LINKS -->  
    
    
    
    
   <?php if($item['show_price'] !="no"){ ?>
    

	<div style="clear:both;"></div>

 
	<hr />
    
     <?php
 
	/***************** SHIPPING METHODS *****************/
	/********************************************************/
			
	if(get_post_meta($post->ID, "shipping", true) !=""){ 
			
	$SIZEARRAY = explode(",",get_post_meta($post->ID, "shipping", true)); 
				
	?>
            
	<p style="line-height:30px;"><b><?php echo SPEC($GLOBALS['_LANG']['_shippingcost']) ?>:</b></p>
     <div style="background:#eee; border:1px solid #ddd; padding:10px; line-height:30px; margin-bottom:10px;">            
				
	<?php 
				
	$i=1; 
				
	foreach($SIZEARRAY as $value){ $sp = explode("=",$value); 
				
	if($i ==1){ $GLOBALS['default_shipping'] = $sp[1]; }
	?>
                
          <input name="ship" type="radio" value="<?php echo $sp[1]; ?>" onclick="ChangeCustomShip(this.value);" 
	<?php if($i ==1){ print "checked"; } ?>/> <?php echo $_SESSION['currency_symbol'].$sp[1]; ?> - <?php echo $sp[0]; ?> <br />
                
    <?php $i++; } ?> 
	
     <?php } ?>
	 

 	<?php } ?>


	<?php if($GLOBALS['adminads'] ==1){ 
	
			if(file_exists(FilterPath()."/wp-content/themes/shopperpress/ads/_ad_single_top_image.php")){ 
			include(FilterPath()."/wp-content/themes/shopperpress/ads/_ad_single_top_image.php");
		}
	
	 } ?>


	<div class="MainDesc" style="line-height:25px;margin-bottom:20px; <?php if($GLOBALS['shopperpress']['system'] =="download"){ ?>display:none;<?php } ?>">
	
		<h2 style="font-size:13px;"><?php echo SPEC($GLOBALS['_LANG']['_info']) ?>:</h2>
		 
		<div style="clear:both;"></div>
	
		<?php the_excerpt(); ?>

		<!-- product warranty -->
		<?php if($item['warranty'] !=""){ ?>
		<h2 style="font-size:13px;"><?php echo SPEC($GLOBALS['_LANG']['_warranty']) ?>:</h2>

		<div style="clear:both;"></div>

		<ul><li><?php echo $item['warranty'] ?></li></ul>	
	
		<?php } ?>

		<!-- product extra data -->
		<?php if($item['extra'] !=""){ ?>
		<h2 style="font-size:13px;"><?php echo SPEC($GLOBALS['_LANG']['_infoextra']) ?>:</h2>

		<div style="clear:both;"></div>

		<ul><li><?php echo $item['extra'] ?></li></ul>	
	
		<?php } ?>

	</div>

 
</div>

<!-- end right side box -->

<div style="clear:both;"></div>
 
</div>

<!-- end top box -->

<?php } //end none article ?>
 
<div style="clear:both;"></div>

</div>













<?php 


/*************************** THIS IS NOT A PRODUCT PAGE BUT AN ARTICLE PAGE ****************************/
/*******************************************************************************************************/



if($item['type'] =="article"){ ?>

<h1 class="ItemBoxTop" style="margin-top:0px; margin-bottom:-5px;">
	<b class="ItemLineHeight"><?php the_title(); ?></b>
</h1>

<div class="ItemBox">	

	 <?php if ($DisplayImage) { ?>
	 <div class="pic fl">
		<img src="<?php echo $DisplayImage; ?>" alt="Post Pic" style="float:left; margin-right:20px; margin-bottom:30px; margin-left:30px; max-width:250px; padding-top:30px;;" />
	  </div>
	 <?php } ?>
 
	<div style="margin-left:30px; padding-top:30px;">

	<div class="post-title">
	<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>	

	<div class="post-date"><em>On <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>,   <?php if($hits != ""){ echo SPEC($GLOBALS['_LANG']['_views'])." ".$hits." ,"; } ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?> </em></div>
	<br />
	
	<?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>

	</div>
 	</div>
 <div style="clear:both;"></div>
	 
</div>
<?php } ?>
<!-- END ARTICLE CONTENT DESCRIPTION -->






<!-- MAIN CONTENT DESCRIPTION -->
<?php if(get_option("display_description") !="no" && $item['type'] !="article"){ ?>
<h1 class="ItemBoxTop"><b class="ItemLineHeight"><?php echo SPEC($GLOBALS['_LANG']['_itemdescription']) ?></b></h1>

<div class="ItemBox">	
 
	<?php /*
		UNCOMMENT THIS IF YOU WANT TO DISPLAY AMAZON IMAGES 
		echo str_replace("https : //","https://",str_replace("http : //","http://",$post->post_content));
		
		*/ ?>
	<div class="inner"><?php the_content(); ?></div>

</div>
<?php } ?>
<!-- END CONTENT DESCRIPTION -->

 
<!-- START COMMENTS BOX -->

<?php 

	if( ( get_option("display_review") =="yes" ) || ( $item['type']=="article" ) ){ ?>	
	<h1 class="ItemBoxTop"><b class="ItemLineHeight"><?php if($item['type']=="article"){ echo "Leave a Comment"; }else{ echo SPEC($GLOBALS['_LANG']['_itemreviews']); } ?></b></h1> 

	<div class="ItemBox">	

		<div class="inner"><?php comments_template('',true); ?> </div>

	</div>
<?php } ?>
	
<!-- END COMMENTS BOX --> 


<?php

$Related = get_post_meta($post->ID, "related_items", true);
if(strlen($Related) > 2){
$items = explode(",",$Related); ?>


<h1 class="ItemBoxTop"><b class="ItemLineHeight">Related Items</b></h1>

<div class="ItemBox">	
 
	<div class="inner">
<?php

foreach($items as $id){
$related = get_post( $id );

$DisplaayImage = get_post_meta($related->ID, "thumbnail", true);
				if($DisplaayImage ==""){

					$DisplaayImage = get_post_meta($related->ID, "image", true);
				}
 				 
				$oldPrice = get_post_meta($related->ID, "old_price", true);
?>
<div style="float:left; width:230px; height:240px; text-align:center">

		<a href="<?php echo get_permalink($related->ID)?>" rel="bookmark" title="<?php echo $related->post_title ?>"><img src="<?php echo SPImage($DisplaayImage,"m"); ?>" alt="<?php echo $data[$i]['title']; ?>" style="max-width:115px;"></a>

<p><a href="<?php echo get_permalink($related->ID)?>" rel="bookmark" title="<?php echo $related->post_title ?>"><?php echo $related->post_title ?></a></p>
<p><?php if($GLOBALS['shopperpress']['price_tag'] !="no"){ ?><?php if(strlen($oldPrice) > 1){ ?><strike><?php echo $_SESSION['currency_symbol']; ?> <?php echo ShopperPressMoneyFormat(get_post_meta($related->ID, "old_price", true)); ?></strike><?php } ?><?php echo $_SESSION['currency_symbol']; ?> <?php echo ShopperPressMoneyFormat(GetPrice(get_post_meta($related->ID, "price", true))); ?><?php } ?></p>


</div>

<?php } ?>  
<div style="clear:both;"></div>
	</div>

</div>
<?php } ?>


</td><td width="201" valign="top" style="padding:10px;padding-top:2px;"> 
<div style="width:200px">



	<?php 
	/*
	*	info: Display Shopping Cart
	*/
	
	if( get_option("display_cart") =="yes"){ 
	
		include("_shoppingcart.php"); 
	
	} ?>



	<?php 
	/*
	*	info: Display Categories Box
	*/
	
	if(get_option("display_catbar") =="yes"){  ?>
	<style>
	.menubox_box ul { width:200px;  padding-left:0px;} .menubox_box ul li {  margin:10px; margin-left:20px;}
	</style>
	<div class="menubox_box">	
	<ul><?php echo ShopperPress_Navigation(1); ?></ul>
	</div><br />
	<?php } ?>

	<div id="ItemProductList">
		<?php 
		
			/*
			*	info: Featured Items
			*/
			
		if(get_option("display_fea_num") !=""){
			$FeaturedAmount = get_option("display_fea_num");
		}else{
			$FeaturedAmount = 8;
		}

		if(get_option("display_featured") =="yes" ){ 
		$data = shopperPress_featured($FeaturedAmount,"ID");
		$i=1; while($i < $FeaturedAmount){ if(isset($data[$i]['link'])){ ?>
		
		<a href="<?php echo $data[$i]['link']; ?>" rel="bookmark" title="<?php echo $data[$i]['title']; ?>"><img src="<?php echo SPImage($data[$i]['image'],"m"); ?>" alt="<?php echo $data[$i]['title']; ?>" style="max-width:115px;"></a>
		<p><a href="<?php echo $data[$i]['link']; ?>" title="<?php echo substr($data[$i]['title'],0,15); ?>"><?php echo $data[$i]['title']; ?></a></p>
		<p>
		
			<?php if($data[$i]['old_price'] > 0 && $item['show_price'] =="yes"){ ?> <span class="oldprice"><?php echo SPEC($GLOBALS['_LANG']['_was']) ?> <strike> <?php echo $_SESSION['currency_symbol'].ShopperPressMoneyFormat($data[$i]['old_price']); ?></strike></span><?php } ?>
			<?php if(strlen($data[$i]['price']) > 1 && $item['show_price'] =="yes"){  echo $_SESSION['currency_symbol'].ShopperPressMoneyFormat(GetPrice(get_post_meta($data[$i]['id'], "price", true))); }  ?>
		
		</p>			
		<?php } $i++; } } ?>	
	





	<?php 


	if(strlen(get_option("display_sidebar_items")) > 0){

	$hotitems = explode(",",get_option("display_sidebar_items"));
 
	foreach($hotitems as $hot){ if(is_numeric($hot)){

		$featured = get_post( $hot );
	  
		$FeaturedImage = get_post_meta($featured->ID, "thumbnail", true);
	
		if($FeaturedImage==""){
		$FeaturedImage = get_post_meta($featured->ID, "image", true);
		}

$old_price = get_post_meta($featured->ID, "old_price", true);
$price = get_post_meta($featured->ID, "price", true);
	?>
		<a href="<?php echo get_permalink($hot); ?>" rel="bookmark"><img src="<?php echo SPImage($FeaturedImage); ?>" alt="<?php echo $featured->post_title; ?>" style="max-width:115px;"></a>
		<p><a href="<?php echo get_permalink($hot); ?>" title="<?php echo $featured->post_title; ?>"><?php echo $featured->post_title; ?></a></p>
		<p>
		
			<?php if($old_price >0){ ?> <span class="oldprice"><?php echo SPEC($GLOBALS['_LANG']['_was']) ?> <strike> <?php echo $_SESSION['currency_symbol'].ShopperPressMoneyFormat($old_price); ?></strike></span><?php } ?>
			<?php if(strlen($price) > 1){  echo $_SESSION['currency_symbol'].ShopperPressMoneyFormat(GetPrice(get_post_meta($featured->ID, "price", true))); }  ?>
		
		</p>	

	<?php $i++; } } } ?>

	</div>








<?php echo shopperpress_banner("right"); ?>

</div>
</td></tr></table>

<!-- do not remove, used for QTY fields -->
<input type="hidden" value="0" id="QtyTotal">

<?php 

endwhile; 

endif; 

get_footer(); 

} ?>